// import { Appearance } from 'react-native-appearance';
import LoadingView from 'react-native-cdy-baseui/components/LoadingView';
import BaseTabPage from 'react-native-cdy-baseui/components/BaseTabPage';
import ListRow from 'teaset/components/ListRow/ListRow';

const DARK = 'dark';
const ColorConstants = {
    darkMode: '0',
    colorScheme: () => {
        if (ColorConstants.darkMode === '0') {
            return 'light';
        } else if (ColorConstants.darkMode === '1') {
            return DARK;
        } else {
            return "light";
            // return Appearance.getColorScheme();
        }
    },
    updateColorScheme: (darkMode) => {
        ColorConstants.darkMode = darkMode;
        LoadingView.defaultProps = Object.assign({}, LoadingView.defaultProps, {
            backgroundColor: ColorConstants.backgroundColor(),
            color: ColorConstants.thirdLabelColor()
        });

        BaseTabPage.defaultProps = Object.assign({}, BaseTabPage.defaultProps, {
            tabBarStyle: { backgroundColor: ColorConstants.backgroundColor() }
        });

        ListRow.defaultProps = Object.assign({}, ListRow.defaultProps, {
            style: { backgroundColor: ColorConstants.contentBackgroundColor() }
        });
    },
    primaryColor: () => '#0178C0',
    backgroundColor: () => (ColorConstants.colorScheme() === DARK ? 'black' : '#f2f2f2'),
    barBackgroundColor: () => (ColorConstants.colorScheme() === DARK ? '#1F1F1F' : '#FBFBFB'),
    contentBackgroundColor: () => (ColorConstants.colorScheme() === DARK ? '#141414' : 'white'),
    whiteBackgroundColor: () => (ColorConstants.colorScheme() === DARK ? 'black' : 'white'),
    grayBackgroundColor: () => (ColorConstants.colorScheme() === DARK ? '#1F1F1F' : '#F3F4F5'),
    blackLabelColor: () => (ColorConstants.colorScheme() === DARK ? 'white' : 'black'),
    firstLabelColor: () => (ColorConstants.colorScheme() === DARK ? '#CCC' : '#333'),
    secondLabelColor: () => (ColorConstants.colorScheme() === DARK ? '#A0A0A0' : '#666'),
    thirdLabelColor: () => (ColorConstants.colorScheme() === DARK ? '#7B7B7B' : '#999'),
    placeholderColor: () => (ColorConstants.colorScheme() === DARK ? '#aaa' : '#aaa'),
    separatorColor: () => (ColorConstants.colorScheme() === DARK ? '#474747' : '#eee'),
    margueeBackgroundColor: () => (ColorConstants.colorScheme() === DARK ? '#1F1F1F' : '#FEEEE7')
};
export default ColorConstants;
